from openpyxl import Workbook
from openpyxl.drawing.image import Image

wb = Workbook()
ws = wb.active

# 单元格标题
ws['A1'] = 'You should see three logos below'

# create an image
# 创建一个图像
img = Image('logo.jpg')
# add to worksheet and anchor next to cells

# 添加图像
ws.add_image(img, 'A2')

# 保存Excel
wb.save('logo.xlsx')
